package com.gee.spring.boot.rpf.client.gaode;

import com.gee.spring.boot.rpf.client.AbstractClient;
import com.gee.spring.boot.rpf.util.CommonUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * desc:
 *
 * @author gee wrote on  2020-10-15 15:57:13
 */
@Component
@Scope("prototype")
public class GaoDeClient extends AbstractClient<GaoDeRequest, GaoDeResponse> {

    private final Logger logger = LoggerFactory.getLogger(GaoDeClient.class);
    @Override
    public String getCacheKey(GaoDeRequest req) {
        return CommonUtil.buildRequestCacheKey(req.getAddress());
    }

    @Override
    public GaoDeResponse call(GaoDeRequest clientRequest) throws Exception {
        Thread.sleep(1000);
        GaoDeResponse response = new GaoDeResponse();
        response.setCode("000000");
        response.setMsg("调用成功");
        response.setLat("112.32");
        response.setLot("89.124");
        return response;
    }
}
